﻿using System.Collections.Generic;

namespace Panda.Utils
{
    public static class RepeatNumberToStringOptimizer
    {

        private static readonly Dictionary<int, string> NumberToString = new Dictionary<int, string>();

        public static string GetString(int number)
        {
            if (NumberToString.TryGetValue(number, out var res))
            {
                return res;
            }

            res = number.ToString();
            NumberToString[number] = res;

            return res;
        }

    }
}